import React from 'react'
import {Card, Button} from 'antd'
import './ui.less'
export default class Buttons extends React.Component{
  state = {
    loading: true
  }
  render(){
    return (
      <div>
        <Card title="基础按钮">
          <Button type="primary">提交</Button>
          <Button>提交</Button>
          <Button type="dashed">提交</Button>
          <Button type="danger">提交</Button>
          <Button disabled>提交</Button>
        </Card>
        <Card title="图形按钮">
          <Button icon="plus">创建</Button>
          <Button icon="edit">编辑</Button>
          <Button type="dashed" icon="delete">删除</Button>
          <Button shape='circle' icon='search'></Button>
          <Button type="primary" icon="search">搜索</Button>
          <Button type="primary" icon="download">下载</Button>
        </Card>
        <Card title="Loading按钮">
          <Button type="primary" loading={true}>确定</Button>
          <Button type="primary" shape="circle" loading={true}></Button>
          <Button loading={true}>点击加载</Button>
          <Button shape='circle' icon='search'></Button>
          <Button type="primary" loading={this.state.loading} icon="search">搜索</Button>
          <Button type="primary" onClick={this.handleClick}>关闭</Button>
        </Card>
        <Card title="按钮组">
          <Button.Group>
            <Button>返回</Button>
            <Button>前进</Button>
          </Button.Group>
        </Card>
      </div>
    );
  }
  handleClick = ()=> {
    this.setState({
      loading: false
    })
  }
}